* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Orbitron', 'Arial', sans-serif;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00f3ff, #ff00ff);
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(255, 0, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00f3ff, #ff00ff);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
}

body {
    background: #0a0a12;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(0, 243, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(255, 0, 255, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a12 0%, #0d0d24 50%, #0a0a12 100%);
    color: #fff;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(0, 243, 255, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(0, 243, 255, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: -1;
}

.landscape-hint {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 18, 0.97);
    backdrop-filter: blur(10px);
}

.hint-content {
    text-align: center;
    animation: hintPulse 2s ease-in-out infinite;
}

.hint-content .fa-mobile-alt {
    font-size: 4rem;
    color: #00f3ff;
    text-shadow: 0 0 20px #00f3ff, 0 0 40px #00f3ff;
    display: block;
    margin-bottom: 10px;
}

.rotate-icon {
    font-size: 2.5rem;
    color: #ff00ff;
    text-shadow: 0 0 15px #ff00ff;
    display: block;
    margin-bottom: 20px;
    animation: rotateHint 2s ease-in-out infinite;
}

.hint-content p {
    font-size: 1.4rem;
    color: #00f3ff;
    text-shadow: 0 0 10px #00f3ff;
    margin-bottom: 8px;
}

.hint-sub {
    font-size: 0.85rem !important;
    color: #ff00ff !important;
    text-shadow: 0 0 8px #ff00ff !important;
    letter-spacing: 2px;
}

@keyframes hintPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(90deg); }
    75% { transform: rotate(0deg); }
}

.container {
    width: 100%;
    height: 100vh;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.neon-header {
    flex-shrink: 0;
    text-align: center;
    padding: 8px 16px;
    background: rgba(10, 10, 18, 0.85);
    border-radius: 10px;
    border: 2px solid #00f3ff;
    box-shadow:
        0 0 15px rgba(0, 243, 255, 0.3),
        inset 0 0 15px rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(5px);
    margin-bottom: 6px;
}

.neon-text {
    color: #00f3ff;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    text-shadow:
        0 0 10px #00f3ff,
        0 0 20px #00f3ff,
        0 0 30px #00f3ff;
    letter-spacing: 2px;
    margin-bottom: 2px;
    position: relative;
    display: inline-block;
}

.neon-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    filter: blur(15px);
    opacity: 0.7;
}

.neon-sub {
    color: #ff00ff;
    font-size: clamp(0.65rem, 1.2vw, 0.9rem);
    text-shadow: 0 0 10px #ff00ff;
}

.game-stats {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 8px;
    background: rgba(10, 10, 18, 0.85);
    padding: 6px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid #00f3ff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.sun-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: bold;
    color: #ffff00;
    gap: 8px;
}

.sun-icon {
    width: clamp(26px, 3.5vw, 36px);
    height: clamp(26px, 3.5vw, 36px);
    background: radial-gradient(circle at 30% 30%, #ffff00, #ffaa00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 15px #ffff00,
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.level-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.level {
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    color: #00f3ff;
    margin-bottom: 4px;
    text-shadow: 0 0 5px #00f3ff;
}

.wave-container {
    width: 100%;
    max-width: 280px;
}

.wave-indicator {
    height: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #00f3ff;
}

.wave-progress {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #00f3ff, #0088ff);
    border-radius: 5px;
    transition: width 0.5s;
    box-shadow: 0 0 10px #00f3ff;
}

.wave-text {
    margin-top: 3px;
    color: #ff00ff;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
}

.stats-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.zombies-remaining {
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    color: #ff4444;
    text-shadow: 0 0 5px #ff4444;
}

.shovel-container {
    display: flex;
    justify-content: center;
}

.shovel-option {
    background: rgba(255, 100, 0, 0.2);
    border: 2px solid #ff6600;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    color: #ff6600;
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 70px;
}

.shovel-option:hover {
    background: rgba(255, 100, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 0 10px #ff6600;
}

.shovel-option.active {
    background: rgba(255, 100, 0, 0.6);
    border-color: #ffff00;
    box-shadow: 0 0 15px #ffff00;
}

.shovel-cost {
    font-size: clamp(0.6rem, 0.9vw, 0.75rem);
    color: #ffff00;
}

.game-area {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 10px;
    overflow: hidden;
}

.lawn {
    flex: 3;
    min-width: 0;
    background: rgba(0, 20, 15, 0.8);
    border: 3px solid #00f3ff;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(0, 243, 255, 0.3),
        inset 0 0 30px rgba(0, 243, 255, 0.1);
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(0, 243, 255, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(0, 243, 255, 0.08) 1px, transparent 1px);
    pointer-events: none;
    z-index: 1;
}

.lawn-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 5px;
    position: relative;
    z-index: 2;
}

.lawn-cell {
    background: rgba(0, 243, 255, 0.04);
    border: 1px solid rgba(0, 243, 255, 0.25);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.lawn-cell:hover {
    background: rgba(0, 243, 255, 0.12);
    border-color: #00f3ff;
}

.lawn-cell.highlight {
    background: rgba(255, 255, 0, 0.3);
    border-color: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

.plants-panel {
    flex-shrink: 0;
    width: 220px;
    background: rgba(10, 10, 18, 0.9);
    border-radius: 10px;
    padding: 10px;
    border: 2px solid #ff00ff;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plants-panel::-webkit-scrollbar {
    width: 6px;
}

.plants-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.plants-panel::-webkit-scrollbar-thumb {
    background: #ff00ff;
    border-radius: 3px;
    box-shadow: 0 0 5px #ff00ff;
}

.panel-controls {
    flex-shrink: 0;
}

.panel-plants {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.panel-plants h2 {
    color: #ff00ff;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #00f3ff;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    text-shadow: 0 0 5px #ff00ff;
}

.panel-instructions {
    flex-shrink: 0;
}

.plant-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plant-option {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plant-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.plant-option.selected {
    border-color: #00f3ff;
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 15px #00f3ff;
}

.plant-icon {
    width: clamp(36px, 5vw, 50px);
    height: clamp(36px, 5vw, 50px);
    border-radius: 50%;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 2vw, 1.5rem);
    box-shadow:
        0 0 15px currentColor,
        inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.plant-sunflower .plant-icon {
    background: radial-gradient(circle at 30% 30%, #ffff00, #ffaa00);
    color: #ff8800;
}

.plant-peashooter .plant-icon {
    background: radial-gradient(circle at 30% 30%, #00ff00, #008800);
    color: #00ff00;
}

.plant-wallnut .plant-icon {
    background: radial-gradient(circle at 30% 30%, #ff6600, #cc4400);
    color: #ff8800;
}

.plant-cherrybomb .plant-icon {
    background: radial-gradient(circle at 30% 30%, #ff0000, #880000);
    color: #ff5555;
}

.plant-cost {
    color: #ffff00;
    font-weight: bold;
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    margin-bottom: 2px;
}

.plant-name {
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 1px;
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
}

.plant-desc {
    font-size: clamp(0.6rem, 0.9vw, 0.75rem);
    color: #aaaaaa;
    text-align: center;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.neon-btn {
    padding: 8px 14px;
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-btn {
    background: linear-gradient(to bottom, #00f3ff, #0088aa);
    color: #0a0a12;
    border: 2px solid #00f3ff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.start-btn:hover {
    background: linear-gradient(to bottom, #00c8dd, #006688);
    box-shadow: 0 0 15px #00f3ff;
    transform: translateY(-2px);
}

.restart-btn {
    background: linear-gradient(to bottom, #ff00ff, #880088);
    color: #ffffff;
    border: 2px solid #ff00ff;
}

.restart-btn:hover {
    background: linear-gradient(to bottom, #cc00cc, #660066);
    box-shadow: 0 0 15px #ff00ff;
    transform: translateY(-2px);
}

.instructions {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid rgba(0, 243, 255, 0.4);
}

.instructions h3 {
    color: #00f3ff;
    margin-bottom: 6px;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
}

.instructions p {
    margin: 3px 0;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    color: #cccccc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plant {
    position: absolute;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.8rem, 1.8vw, 1.6rem);
    z-index: 10;
    transition: transform 0.2s;
    user-select: none;
    box-shadow:
        0 0 15px currentColor,
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.zombie {
    position: absolute;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.8rem, 1.8vw, 1.6rem);
    z-index: 5;
    transition: left 0.1s linear;
    filter: drop-shadow(0 0 5px currentColor);
}

.projectile {
    position: absolute;
    width: clamp(8px, 1.5vw, 15px);
    height: clamp(8px, 1.5vw, 15px);
    border-radius: 50%;
    z-index: 8;
    background: #00f3ff;
    box-shadow: 0 0 10px #00f3ff, 0 0 20px #00f3ff;
}

.sun {
    position: absolute;
    width: clamp(16px, 3vw, 25px);
    height: clamp(16px, 3vw, 25px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffff00, #ffaa00);
    z-index: 7;
    cursor: pointer;
    animation: float 4s infinite ease-in-out;
    box-shadow: 0 0 10px #ffff00;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(120deg); }
    66% { transform: translateY(-5px) rotate(240deg); }
}

.message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 18, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.message-content {
    background: linear-gradient(135deg, #0a0a12, #1a0033);
    padding: clamp(20px, 4vw, 40px);
    border-radius: 15px;
    text-align: center;
    border: 3px solid #00f3ff;
    box-shadow:
        0 0 30px #00f3ff,
        inset 0 0 30px rgba(0, 243, 255, 0.1);
    max-width: 500px;
    width: 90%;
}

.message h2 {
    color: #00f3ff;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00f3ff;
}

.message p {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    margin-bottom: 15px;
    color: #ffffff;
}

.message button {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    background: linear-gradient(to bottom, #ff00ff, #880088);
    border: 2px solid #ff00ff;
}

.message button:hover {
    background: linear-gradient(to bottom, #cc00cc, #660066);
    box-shadow: 0 0 20px #ff00ff;
}

@media (max-width: 768px) and (orientation: portrait) {
    .landscape-hint {
        display: flex;
    }

    .container {
        display: none;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .landscape-hint {
        display: none;
    }

    .container {
        padding: 2px 4px;
        height: 100vh;
    }

    .neon-header {
        display: none;
    }

    .game-stats {
        flex-shrink: 0;
        padding: 2px 6px;
        margin-bottom: 2px;
        gap: 4px;
        border-radius: 4px;
        font-size: 0.7rem;
    }

    .sun-counter {
        font-size: 0.75rem;
        gap: 3px;
    }

    .sun-icon {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
    }

    .level {
        font-size: 0.65rem;
        margin-bottom: 1px;
    }

    .wave-indicator {
        height: 4px;
    }

    .wave-text {
        font-size: 0.5rem;
        margin-top: 0;
    }

    .zombies-remaining {
        font-size: 0.65rem;
    }

    .shovel-option {
        padding: 2px 4px;
        font-size: 0.5rem;
        min-width: 40px;
        gap: 1px;
    }

    .shovel-cost {
        font-size: 0.4rem;
    }

    .game-area {
        flex: 1;
        min-height: 0;
        gap: 4px;
    }

    .lawn {
        flex: 3;
        border-width: 2px;
        border-radius: 4px;
    }

    .lawn-grid {
        gap: 1px;
        padding: 2px;
    }

    .plants-panel {
        flex-shrink: 0;
        width: 120px;
        min-height: 0;
        padding: 4px;
        border-radius: 4px;
        gap: 3px;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .panel-controls {
        flex-shrink: 0;
    }

    .panel-plants {
        flex: 1;
        min-height: 80px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .panel-plants h2 {
        font-size: 0.6rem;
        margin-bottom: 3px;
        padding-bottom: 2px;
    }

    .panel-instructions {
        display: none;
    }

    .plant-options {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .plant-option {
        padding: 3px;
        border-radius: 4px;
        flex-shrink: 0;
    }

    .plant-icon {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
        margin-bottom: 1px;
    }

    .plant-cost {
        font-size: 0.5rem;
        margin-bottom: 0;
    }

    .plant-name {
        font-size: 0.5rem;
        margin-bottom: 0;
    }

    .plant-desc {
        display: none;
    }

    .game-controls {
        gap: 2px;
    }

    .neon-btn {
        padding: 4px 6px;
        font-size: 0.55rem;
        gap: 2px;
        border-radius: 4px;
    }
}
